package com.star.message.api;

import com.star.common.core.contract.Page;
import com.star.common.core.contract.R;
import com.star.common.sms.contract.query.SendDetailPageQuery;
import com.star.common.sms.contract.query.SendStatisticsPageQuery;
import com.star.common.sms.contract.vo.SendDetailPageVO;
import com.star.common.sms.contract.vo.SendStatisticsPageVO;
import com.star.message.biz.SmsStaticsBizService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 短信统计相关
 *
 * @author zhouhengzhe
 */
@RestController
@RequiredArgsConstructor
@Tag(name = "短信统计相关", description = "短信统计相关")
@RequestMapping("/message/sms/statics")
public class SmsStaticsController {

    private final SmsStaticsBizService smsStaticsBizService;

    /**
     * 分页查询短信发送记录和发送状态等信息
     *
     * @param query 查询参数
     * @return 短信发送记录和发送状态等信息
     */
    @PostMapping("pageSendDetail")
    @Operation(summary = "查询短信发送记录和发送状态等信息")
    public R<Page<SendDetailPageVO>> pageSendDetail(SendDetailPageQuery query){
        return R.ok(smsStaticsBizService.pageSendDetail(query));
    }

    /**
     * 查询短信发送量详情
     *
     * @param query 查询参数
     * @return 短信发送量详情
     */
    @PostMapping("pageSendStatistics")
    @Operation(summary = "查询短信发送量详情")
    public R<Page<SendStatisticsPageVO>> pageSendStatistics(SendStatisticsPageQuery query){
        return R.ok(smsStaticsBizService.pageSendStatistics(query));
    }
}
